home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / geomutil / plutil / anytooff.main.c < prev    next >
C/C++ Source or Header  |  1993-11-02  |  860b  |  40 lines

  1. /*
  2.  * anytooff.main.c
  3.  * author:  Celeste Fowler
  4.  * date:  June 12, 1992
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include "geom.h"
  9. #include "transform.h"
  10. #include "plutil.h"
  11.  
  12. main(int argc, char *argv[]) {
  13.   Geom *g, *gpl, *pl = NULL;
  14.   int i;
  15.  
  16.   if(argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
  17.     fprintf(stderr, "\
  18. Usage: %s [filename ...]  -- convert OOGL file(s) to OFF format\n\
  19. Writes to standard output.  Reads from stdin if no file(s) specified.\n\
  20. Produces the union of all file(s) if several are specified.\n",
  21.     argv[0]);
  22.     exit(1);
  23.   }
  24.  
  25.   if(argc <= 1) {
  26.     argc = 2;
  27.     argv[1] = "-";
  28.   }
  29.   for(i = 1; i < argc; i++) {
  30.     g = strcmp(argv[i], "-") ? GeomLoad(argv[i]) : GeomFLoad(stdin, "standard input");
  31.     gpl = AnyToPL(g, TM_IDENTITY);
  32.     if(pl) pl = PLCombine(pl, gpl);
  33.     else pl = gpl;
  34.   }
  35.   GeomFSave(pl, stdout, NULL);
  36.   return 0;
  37. }
  38.  
  39.   
  40.